package com.xrui.lexer;

import org.antlr.v4.runtime.CharStreams;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.Token;

import java.util.List;

public class LexerTest {
    public static void main(String args[]){
        String exprStr = "aaa+random(a,b)";
        Expression exprLexer = new Expression(CharStreams.fromString(exprStr));
        Token token = exprLexer.nextToken();
        while (token.getType() != Token.EOF)
        {
            System.out.println("The token type is " + token.getType() + " the token value is " + token.getText());
            token = exprLexer.nextToken();
        }


//        CommonTokenStream tokens = new CommonTokenStream(exprLexer);
//        List<Token> tokenList = tokens.getTokens();
//        for (Token tokenlocal : tokenList) {
//            System.out.println("The token type is " + tokenlocal.getType() + " the token value is " + tokenlocal.getText());
//
//        }
    }
}
